{include app:admin.inc.header}
<!--tmpl-resource-->
{include app:admin.inc.top}


<div class="container-fluid content-body">
	<div class="main">
		<!-- left side start-->
		{include admin.inc.menu}
		<!-- left side end-->


		<!-- main content start-->
		<section class="right-section" id="right-section">
			<!-- start of inner-frame -->
			<div class="inner-iframe">

				<!-- page breadcrumb start-->
				{include admin.inc.bread}
				<!-- page "breadcrumb end-->
				<!-- Nav tabs -->
				<ul class="nav nav-tabs">

					<li><a href="{$add_url}"><i class="glyphicon glyphicon-plus"></i> 添加角色</a></li>
					<li class="active"><a href="javascript:void(0);"><i class="glyphicon glyphicon-th-list"></i> 角色列表</a></li>

				</ul>
				<div class="inner-container">
					<form class="form-inline search-form" role="form" id="J_List_Form">
						<input type="hidden" name="pagesize" value="{$pagesize}" >
						<!-- search form start -->
						<!--tmpl-search-->

						<!-- searchinput -->
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									角色名称	
								</div>
								<input type="text" class="form-control input-sm" maxlength="20" placeholder="" name="s_name" value="{$s_name}">
							</div>
						</div>
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									添加时间
								</div>
								<input style="width:100px;" class="form-control form-control-inline input-sm mdate"  size="16" type="text"
									   name="s_s_addtime" value="{$s_s_addtime}"
									   placeholder="开始时间" />

								<div class="input-group-addon">
									-
								</div>
								<input style="width:100px;" class="form-control form-control-inline input-sm mdate"  size="16" type="text"
									   name="s_e_addtime" value="{$s_e_addtime}"
									   placeholder="结束时间" />
							</div>
						</div>
						<input type="hidden" name="order" value="{$order}">
						<button type="submit" class="btn btn-sm btn-success">搜索</button>
						{run exportBtn()}
						<!-- search form end -->
					<!--</form>
					<form id="J_List_Form">-->
						<div class="table-responsive">
							<table id="J_ListTable" class="table  table-hover  table-striped">
								<!--tmpl-listtable-->

								<!-- listblock -->
								<thead>
									<tr>
										<th width="20"><input type="checkbox" class="icheck check-all" /></th>
										<!--tmpl-fieldheaders-->
								
										<th>角色名称<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="name ASC"}name DESC{else}name ASC{/if}' class='fa ofield {if $order=="name ASC"}fa-chevron-up{elseif $order=="name DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>

										<th>角色描述<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="remark ASC"}remark DESC{else}remark ASC{/if}' class='fa ofield {if $order=="remark ASC"}fa-chevron-up{elseif $order=="remark DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>添加时间<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="addtime ASC"}addtime DESC{else}addtime ASC{/if}' class='fa ofield {if $order=="addtime ASC"}fa-chevron-up{elseif $order=="addtime DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>修改时间<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="edittime ASC"}edittime DESC{else}edittime ASC{/if}' class='fa ofield {if $order=="edittime ASC"}fa-chevron-up{elseif $order=="edittime DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>账号状态</th>
										<th>操作人<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="manager_id ASC"}manager_id DESC{else}manager_id ASC{/if}' class='fa ofield {if $order=="manager_id ASC"}fa-chevron-up{elseif $order=="manager_id DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
								
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
								{if empty($items)}
								<tr>
									<td style="text-align:center;" colspan="6" class="empty-table-td">{$emptyRecord}</td>
								</tr>
								{/if}
								{loop $items $value}
								<tr>
									<td>{if $myInfo['role_id']!=$value[id]}<input type="checkbox" class="icheck" name="ids[]" value="{$value[id]}"/>{/if}</td>
									<!--tmpl-fieldlist-->
								
									<td>{$value[name]}</td>
									<td>{$value[remark]}</td>
									<td>{$value[addtime]}</td>
									<td>{$value[edittime]}</td>
									<td><input data-id="{$value[id]}" {if $myInfo['id'] == $value[id]}disabled="disabled"{/if} type='checkbox' data-on-text='启用' data-off-text='禁用' class='bswitch js-status' data-size='mini' {if $value[status]}checked{/if} ></td>

									<td>{$value[manager_name]}</td>
								
									<td>
										<!--tmpl-listbtn-->
								
										<!-- listbtnedit -->
										{if in_array('admin/role/edit',$priv) || empty($priv)}
										<a href="{$edit_url}?id={$value[id]}" class="btn btn-primary btn-xs">
											<i class="glyphicon glyphicon-edit"></i> 编辑</a>
										{/if}
										
										<!-- listbtndelete -->
										{if in_array('admin/role/delete',$priv) || empty($priv)}
										<a href="{$delete_url}?id={$value[id]}" class="btn btn-danger btn-xs item-remove">
											<i class="glyphicon glyphicon-trash"></i> 删除</a>
										{/if}
										
								
									</td>
								</tr>
								{/loop}
								

							</table>

						</div>
						
					</form>
					<div class="text-right" style="float: right">
						{$pagemenu}
					</div>

					<div class="button-group pagination" style="float: left">
						<select name="action-bacth-select"  disabled class="form-control input-sm" >
							<option value="" checked="true">-批量操作-</option>
							<option value="on" >启用</option>
							<option value="off">禁用</option>
						</select>
					</div>

				</div>
			</div>
		</section>
	</div>
</div>

<!--footer section start-->
{include admin.inc.footer}
<!--footer section end-->

<!--tmpl-script-->

<!-- assocalert -->
<script id="admin_manager-assoc-box" type="text/html">
<div class="assoc-alertbox">
	<div class="searchbar">
		<form class="assoc-foreign-form form-inline">
			<!--tmpl-search-->

			<!-- searchinput -->
			<div class="form-group">
				<div class="input-group">
					<div class="input-group-addon">
						用户名
					</div>
					<input type="text" class="form-control input-sm" maxlength="20" placeholder="用户名" name="s_username" value="{$s_username}">
				</div>
			</div>
			
			
			
			<!-- searchinput -->
			<div class="form-group">
				<div class="input-group">
					<div class="input-group-addon">
						工号
					</div>
					<input type="text" class="form-control input-sm" maxlength="{maxlength}" placeholder="工号" name="s_jobno" value="{$s_jobno}">
				</div>
			</div>
			
			
			<!-- searchinput -->
			<div class="form-group">
				<div class="input-group">
					<div class="input-group-addon">
						姓名
					</div>
					<input type="text" class="form-control input-sm" maxlength="16" placeholder="姓名" name="s_name" value="{$s_name}">
				</div>
			</div>
			
			<!-- searchselect -->
			<div class="form-group">
				<div class="input-group">
					<div class="input-group-addon">
						角色ID
					</div>
					<select id="s_role_id" class="form-control select2" name="s_role_id">
						<option value="">-- 请选择 --</option>
						<!--tmpl-options-->
			
						<!-- selectoptions -->
						{loop $role_idoptions $v}
						<option {if $item[role_id] == $v[id]}selected{/if} value="{$v[id]}">{$v[id]}</option>
						{/loop}
						
			
					</select>
				</div>
			</div>
			
			<!-- searchdatetime -->
			<div class="form-group">
				<div class="input-group">
					<div class="input-group-addon">
						最后登陆时间
					</div>
					<input style="width:100px;" class="form-control form-control-inline input-sm mdate"  size="16" type="text"
					name="s_s_last_login_time" value="{$s_s_last_login_time}"
					placeholder="开始最后登陆时间" />
			
					<div class="input-group-addon">
						-
					</div>
					<input style="width:100px;" class="form-control form-control-inline input-sm mdate"  size="16" type="text"
					name="s_e_last_login_time" value="{$s_e_last_login_time}"
					placeholder="结束最后登陆时间" />
				</div>
			</div>
			
			
			<!-- searchselect -->
			<div class="form-group">
				<div class="input-group">
					<div class="input-group-addon">
						账户状态
					</div>
					<select id="s_status" class="form-control select2" name="s_status">
						<option value="">-- 请选择 --</option>
						<!--tmpl-options-->
			
						<!-- option -->
						<option value="1">正常</option>
						
						<!-- option -->
						<option value="0">禁用</option>
						
			
					</select>
				</div>
			</div>
			
			<!-- searchdatetime -->
			<div class="form-group">
				<div class="input-group">
					<div class="input-group-addon">
						添加时间
					</div>
					<input style="width:100px;" class="form-control form-control-inline input-sm mdate"  size="16" type="text"
					name="s_s_addtime" value="{$s_s_addtime}"
					placeholder="开始添加时间" />
			
					<div class="input-group-addon">
						-
					</div>
					<input style="width:100px;" class="form-control form-control-inline input-sm mdate"  size="16" type="text"
					name="s_e_addtime" value="{$s_e_addtime}"
					placeholder="结束添加时间" />
				</div>
			</div>
			
			<!-- searchdatetime -->
			<div class="form-group">
				<div class="input-group">
					<div class="input-group-addon">
						更新时间
					</div>
					<input style="width:100px;" class="form-control form-control-inline input-sm mdate"  size="16" type="text"
					name="s_s_updatetime" value="{$s_s_updatetime}"
					placeholder="开始更新时间" />
			
					<div class="input-group-addon">
						-
					</div>
					<input style="width:100px;" class="form-control form-control-inline input-sm mdate"  size="16" type="text"
					name="s_e_updatetime" value="{$s_e_updatetime}"
					placeholder="结束更新时间" />
				</div>
			</div>
			
			

			<input type="hidden" name="order" value="{$order}">
			<input type="btn" class="btn btn-sm btn-success assoc-search-btn" value="搜索"/>
		</form>
	</div>
	<div class="content">
	
	</div>
	<div class="paginate">

	</div>
</div>
</script>

<!-- assoclist -->
<script id="admin_manager-assoc-tablelist" type="text/html">
<table class="table  table-condense">
	<tr>
		<th><input type="checkbox" id="assoc-selectall" ></th>
		<!--tmpl-th-->

		<th>用户名</th>
		<th>密码</th>
		<th>手机号码</th>
		<th>工号</th>
		<th>电子邮箱</th>
		<th>姓名</th>
		<th>角色ID</th>
		<th>最后登陆时间</th>
		<th>最后登陆ip</th>
		<th>账户状态</th>
		<th>添加时间</th>
		<th>更新时间</th>
		<th>AppId</th>

	</tr>
	{[loop items item]}
	<tr>
		<td><input type="checkbox" name="assoc[]" value="{[item.id]}"></td>
		<!--tmpl-td-->

		<td>{[item.username]}</td>
		<td>{[item.password]}</td>
		<td>{[item.mobile]}</td>
		<td>{[item.jobno]}</td>
		<td>{[item.email]}</td>
		<td>{[item.name]}</td>
		<td>{[item.admin_manager_role_id]}</td>
		<td>{[item.last_login_time]}</td>
		<td>{[item.last_login_ip]}</td>
		<td>{[item.status]}</td>
		<td>{[item.addtime]}</td>
		<td>{[item.updatetime]}</td>
		<td>{[item.app_id]}</td>


	</tr>
	{[/loop]}
</table>
</script>

<!-- assocalert -->
<script id="admin_node-assoc-box" type="text/html">
<div class="assoc-alertbox">
	<div class="searchbar">
		<form class="assoc-foreign-form form-inline">
			<!--tmpl-search-->

			<!-- searchinput -->
			<div class="form-group">
				<div class="input-group">
					<div class="input-group-addon">
						
					</div>
					<input type="text" class="form-control input-sm" maxlength="50" placeholder="" name="s_name" value="{$s_name}">
				</div>
			</div>
			
			<!-- searchinput -->
			<div class="form-group">
				<div class="input-group">
					<div class="input-group-addon">
						
					</div>
					<input type="text" class="form-control input-sm" maxlength="50" placeholder="" name="s_node_key" value="{$s_node_key}">
				</div>
			</div>

			<input type="hidden" name="order" value="{$order}">
			<input type="btn" class="btn btn-sm btn-success assoc-search-btn" value="搜索"/>
		</form>
	</div>
	<div class="content">
	
	</div>
	<div class="paginate">

	</div>
</div>
</script>

<!-- assoclist -->
<script id="admin_node-assoc-tablelist" type="text/html">
<table class="table  table-condense">
	<tr>
		<th><input type="checkbox" id="assoc-selectall" ></th>
		<!--tmpl-th-->

		<th></th>
		<th></th>
		<th></th>
		<th></th>
		<th></th>
		<th></th>
		<th></th>
		<th>AppId</th>

	</tr>
	{[loop items item]}
	<tr>
		<td><input type="checkbox" name="assoc[]" value="{[item.id]}"></td>
		<!--tmpl-td-->

		<td>{[item.name]}</td>
		<td>{[item.node_key]}</td>
		<td>{[item.remark]}</td>
		<td>{[item.addtime]}</td>
		<td>{[item.edittime]}</td>
		<td>{[item.admin_manager_id]}</td>
		<td>{[item.del_status]}</td>
		<td>{[item.app_id]}</td>


	</tr>
	{[/loop]}
</table>
</script>



<!-- template -->
<script id="editpanel" type="text/html">
	<div>
		<form id="editpanel-form" class="form-horizontal">
			<div class="row">&nbsp</div>
			<!--tmpl-fieldlist-->

			<!-- input -->
			<div class="form-group">
				<label > </label>
				<input  dtype="" class="form-control" maxlength="50" name="data[name]" placeholder="" required cname="" value="{[name]}" />
			</div>
			<p class="help-block"></p>
			
			<!-- textarea -->
			<div class="form-group">
				<label></label>
				<textarea class="form-control" maxlength="255" name="data[remark]" placeholder="" required cname="">{[remark]}</textarea>
			</div>
			<p class="help-block"></p>
			

			<!--tmpl-assocfields-->

			<!-- assocfield -->
			<div class="form-group" id="box-admin_manager">
				<label >管理员</label>
				<div class="input-group">
					<input type="input" class="form-control" name="assoc-admin_manager" id="assoc-admin_manager" >
					<span class="input-group-btn">
						<input type="button" class="btn btn-warning" value="选择" id="assoc-search-admin_manager">
					</span>
				</div>
				<ul class="assocul" id="assoc-ul-admin_manager">
				</ul>
			</div>
			
			<!-- assocfield -->
			<div class="form-group" id="box-admin_node">
				<label >权限</label>
				<div class="input-group">
					<input type="input" class="form-control" name="assoc-admin_node" id="assoc-admin_node" >
					<span class="input-group-btn">
						<input type="button" class="btn btn-warning" value="选择" id="assoc-search-admin_node">
					</span>
				</div>
				<ul class="assocul" id="assoc-ul-admin_node">
				</ul>
			</div>
			

		</form>
	</div>
</script>

<!-- pagescript -->
<script type="text/javascript">
	seajs.use("admin/admin_roleindex",function (parameter){
		
		/**--tmpl-templatejavascript--**/
		
		<!--tmpl-templatejavascript-->

		parameter.admin_manager_assoc_url="{$admin_manager_assoc_url}";
		parameter.admin_node_assoc_url="{$admin_node_assoc_url}";

		parameter.detailUrl="{$detail_url}";
		parameter.deleteUrl="{$delete_url}";
		parameter.editUrl="{$do_edit_url}";
		parameter.upload_url="{$upload_url}";
		parameter.image_search_url="{$image_search_url}";
		parameter.image_list_url="{$image_list_url}";
		
		parameter.init();		
	});
</script>


<script id="assocpage" type="text/html">
<div class="text-right">
	<ul class="pagination blog-pagination">
		<li><a class="assoc-page" data-page="{[prev]}" href="javascript:void(0);">上一页</a></li> 
		{[each pages]}
			<li {[if curr==page]}class="active"{[/if]}><a class="assoc-page" data-page="{[$value]}"  href="javascript:void(0)">{[$value]}</a></li> 
		{[/each]}
		<li><a class="assoc-page" href="javascript:void(0);" data-page="{[nexts]}">下一页</a></li> 
	</ul>	
</div>
</script>
</body>
</html>
